<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <menu-item :msg='msg' :num='12' :bool='true' :arr='arr' :obj='obj'></menu-item>
    </div>
    <script src="./vue.js"></script>
    <script>
        Vue.component('menu-item', {
            props: ['msg', 'num', 'bool', 'arr', 'obj'],
            template: `
                <div>
                    <p>{{msg}}</p>
                    <p>{{10 + num}}</p>
                    <p>{{bool}}</p>
                    <ul>
                        <li v-for='(item,index) in arr'>{{item}}</li>
                    </ul>
                    <span>{{obj.name}}</span>
                    <span>{{obj.age}}</span>
                </div>
            `
        })
        var vm = new Vue({
            el: '#app',
            data: {
                msg: '父组件中的内容',
                // num: 12
                arr: ['apple', 'banana', 'orange'],
                obj: {
                    name: 'Tom',
                    age: 18
                }
            }
        })
    </script>
</body>

</html>